#include "stdafx.h"
#include "GfxObject.h"

using namespace mgfx;

void GfxObject::updateDrawData( XMFLOAT3 position, XMFLOAT4 orientation, XMFLOAT3 scale )
{
	Position = position;
	Orientation = orientation;
	Scale = scale;

	XMMATRIX world;
	world = XMMatrixScalingFromVector(XMLoadFloat3(&scale));
	world = XMMatrixMultiply(world, XMMatrixRotationQuaternion(XMLoadFloat4(&orientation)));
	world = XMMatrixMultiply(world, XMMatrixTranslationFromVector(XMLoadFloat3(&position)));

	XMStoreFloat4x4(&WorldTransform, world);
}